package cn.iocoder.yudao.module.promotion.controller.admin.prizedraw;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.prizedraw.vo.PrizeDrawNumberMemberPageReqVO;
import cn.iocoder.yudao.module.promotion.controller.admin.prizedraw.vo.PrizeDrawNumberMemberRespVO;
import cn.iocoder.yudao.module.promotion.service.prizedraw.PrizeDrawNumberMemberService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;


@Tag(name = "管理后台 - 用户抽奖次数")
@RestController
@RequestMapping("/promotion/prize-draw-number-member")
@Validated
public class PrizeDrawNumberMemberController {

    @Resource
    private PrizeDrawNumberMemberService prizeDrawNumberMemberService;

    @Operation(summary = "用户抽奖次数分页")
    @GetMapping("/page")
    public CommonResult<PageResult<PrizeDrawNumberMemberRespVO>> paging(PrizeDrawNumberMemberPageReqVO queryDto) {
        return success(prizeDrawNumberMemberService.paging(queryDto));
    }

    @Operation(summary = "导出抽奖抽奖次数记录")
    @GetMapping("/export")
    public CommonResult<Boolean> export(PrizeDrawNumberMemberPageReqVO dto) {
        prizeDrawNumberMemberService.export(dto);
        return success(true);
    }

}